package util;

import java.util.HashMap;
import java.util.Map;

import models.BaseModel;

import org.apache.log4j.Logger;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;


/**
 * @author Rishi Das Roy
 *
 * @Organization Institute Of Genomics & Integrative Biology
 */
public class ModelUtil {
	private static Logger log = Logger.getLogger(ModelUtil.class);
	private  static ApplicationContext mModelFactory = new ClassPathXmlApplicationContext("/models/modelsBean.xml");
	public static BaseModel[] getModels() {
		String []modelNames = mModelFactory.getBeanDefinitionNames();
		BaseModel []models = new BaseModel[modelNames.length];
		for (int i = 0; i < models.length; i++) {
			models[i] = (BaseModel) mModelFactory.getBean(modelNames[i]);
		}
		return models;
	}

	public static final Map<String,String> MODEL_NAMES =  new HashMap<String, String>()
			{{
				put("KGS1_2","Class I / Class II");
				put("KGS1_3","Class I / Class III");
				put("KGS2_3","Class II / Class III");
				put("KGS1_Non","Class I / NGS");
				put("KGS2_Non","Class II / NGS");
				put("KGS3_Non","Class III / NGS");
				put("FGS4_KGS3Minus","Class IV / Class III-");
			}};
}

